<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2020/12/1
 * Time: 16:15
 */
namespace app\common\config;

class weixin_config
{
    // 微信token
    public static $weixin_token  = 'WEIXIM';

    // 第一次关注的消息
    public static $first_req_msg = 'subscribe';

    // 微信app_id
    //public static $app_id     = 'wx3db16e34d17888f6';

    // 微信app_secret
    //public static $app_secret = '675c664f0a9e8851ab28873ff9906e12';

    // 微信app_id
    public static $app_id     = 'wx4070be02a7ce66db';

    // 微信app_secret
    public static $app_secret = '853467ff83d64a622655bcd55f9b3168';

    // 取access_token的url
    //public static $access_token_url = '';

    // 客服接口发送消息
    public static $service_send_url = 'https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token={ACCESS_TOKEN}';

    // 上传多媒体
    public static $upload_url       = 'http://file.api.weixin.qq.com/cgi-bin/media/upload?access_token={ACCESS_TOKEN}&type={TYPE}';

    // 下载多媒体
    public static $download_url     = 'http://file.api.weixin.qq.com/cgi-bin/media/get?access_token={ACCESS_TOKEN}&media_id={MEDIA_ID}';

    // ================永久图文素材  start  ===============
    // 上传永久图文素材
    public static $add_news_url = 'https://api.weixin.qq.com/cgi-bin/material/add_news?access_token={ACCESS_TOKEN}';

    // 修改永久图文素材
    public static $update_news_url = 'https://api.weixin.qq.com/cgi-bin/material/update_news?access_token={ACCESS_TOKEN}';

    // 上传永久图文素材内容中的图片专用接口
    public static $add_news_content_img_url = 'https://api.weixin.qq.com/cgi-bin/media/uploadimg?access_token={ACCESS_TOKEN}';

    // 删除永久图文素材
    public static $del_news_url = 'https://api.weixin.qq.com/cgi-bin/material/del_material?access_token={ACCESS_TOKEN}';
    // ================永久图文  end  ===============


    // 上传其它永久素材（图片、语音、视频）
    public static $add_material_url = 'https://api.weixin.qq.com/cgi-bin/material/add_material?access_token={ACCESS_TOKEN}&type={TYPE}';

    // 预览发送接口
    public static $preview_url = 'https://api.weixin.qq.com/cgi-bin/message/mass/preview?access_token={ACCESS_TOKEN}';


    // ================群发  start  ===============
    // 根据标签进行群发
    public static $mass_sendall_url = 'https://api.weixin.qq.com/cgi-bin/message/mass/sendall?access_token={ACCESS_TOKEN}';

    // 根据根据OpenID列表群发
    public static $mass_send_url = 'https://api.weixin.qq.com/cgi-bin/message/mass/send?access_token={ACCESS_TOKEN}';

    // 查询群发消息发送状态
    public static $masss_send_check_url = 'https://api.weixin.qq.com/cgi-bin/message/mass/get?access_token={ACCESS_TOKEN}';

    // 群发前上传图文素材
    public static $uploadnews_url = 'https://api.weixin.qq.com/cgi-bin/media/uploadnews?access_token={ACCESS_TOKEN}';
    // ================群发  end  ===============


    // 取用户信息
    public static $get_user_url        = 'https://api.weixin.qq.com/cgi-bin/user/info?access_token={ACCESS_TOKEN}&openid={OPENID}&lang=zh_CN';

    // 取所有粉丝的openid
    public static $get_user_open_id_url = 'https://api.weixin.qq.com/cgi-bin/user/get?access_token={ACCESS_TOKEN}';

    // ================分组  start  ===============
    // 创建分组
    public static $create_group_url = 'https://api.weixin.qq.com/cgi-bin/groups/create?access_token={ACCESS_TOKEN}';

    // 修改分组
    public static $update_group_url = 'https://api.weixin.qq.com/cgi-bin/groups/update?access_token={ACCESS_TOKEN}';

    // 移动用户到其它分组
    public static $change_user_group_url = 'https://api.weixin.qq.com/cgi-bin/groups/members/update?access_token={ACCESS_TOKEN}';

    // 获取分组
    public static $get_group_url     = 'https://api.weixin.qq.com/cgi-bin/groups/get?access_token={ACCESS_TOKEN}';
    // ================分组  end  ===============


    // ================标签  start  ===============
    // 添加标签
    public static $add_tags_url = 'https://api.weixin.qq.com/cgi-bin/tags/create?access_token={ACCESS_TOKEN}';

    // 修改标签
    public static $update_tags_url = 'https://api.weixin.qq.com/cgi-bin/tags/update?access_token={ACCESS_TOKEN}';

    // 删除标签
    public static $del_tags_url = 'https://api.weixin.qq.com/cgi-bin/tags/delete?access_token={ACCESS_TOKEN}';

    // 获取公众号所有标签
    public static $get_tags_url = 'https://api.weixin.qq.com/cgi-bin/tags/get?access_token={ACCESS_TOKEN}';

    // 为用户添加标签
    public static $change_user_tags_url = 'https://api.weixin.qq.com/cgi-bin/tags/members/batchtagging?access_token={ACCESS_TOKEN}';

    // 为用户取消标签
    public static $del_user_tags_url = 'https://api.weixin.qq.com/cgi-bin/tags/members/batchuntagging?access_token={ACCESS_TOKEN}';

    // 获取标签下粉丝列表
    public static $get_tag_user_url = 'https://api.weixin.qq.com/cgi-bin/user/tag/get?access_token={ACCESS_TOKEN}';
    // ================标签  end  ===============

    // api调用次数进行清零
    public static $clear_quota_url = 'https://api.weixin.qq.com/cgi-bin/clear_quota?access_token={ACCESS_TOKEN}';


    public static $err_code = array(
        '1'     => '系统繁忙',
        '0'     => '请求成功',
        '40001' => '获取access_token时AppSecret错误，或者access_token无效',
        '40002' => '不合法的凭证类型',
        '40003' => '不合法的OpenID',
        '40004' => '不合法的媒体文件类型',
        '40005' => '不合法的文件类型',
        '40006' => '不合法的文件大小',
        '40007' => '不合法的媒体文件id',
        '40008' => '不合法的消息类型',
        '40009' => '不合法的图片文件大小',
        '40010' => '不合法的语音文件大小',
        '40011' => '不合法的视频文件大小',
        '40012' => '不合法的缩略图文件大小',
        '40013' => '不合法的消息类型',
        '40014' => '不合法的access_token',
        '41001' => '缺少access_token参数',
        '42001' => 'access_token超时',
        '43004' => '消息接收者没有关注或者取消了关注',
        '45007' => '语音播放时间超过限制',
        '45009' => '接口调用超过限制',
        '45011' => 'API调用太频繁，请稍候再试',
        '45015' => '该用户已经超过48小时没有交互',
        '48001' => '报歉，请确保您的公众号开通了此权限',
        '48006' => 'api禁止清零调用次数，因为清零次数达到上限',
        '50001' => '用户未授权该api',
        '65301' => '不存在此menuid对应的个性化菜单',
        '65302' => '没有相应的用户',
        '65303' => '没有默认菜单，不能创建个性化菜单',
        '65304' => 'MatchRule信息为空',
        '65305' => '个性化菜单数量受限',
        '65306' => '不支持个性化菜单的帐号',
        '65307' => '个性化菜单信息为空',
        '65308' => '包含没有响应类型的button',
        '65309' => '个性化菜单开关处于关闭状态',
        '65310' => '填写了省份或城市信息，国家信息不能为空',
        '65311' => '填写了城市信息，省份信息不能为空',
        '65312' => '不合法的国家信息',
        '65313' => '不合法的省份信息',
        '65314' => '不合法的城市信息',
        '85005' => '该小程序需先绑定到当前公众号，请登录微信公众号后台进行绑定'
    );

    // 发送的消息类型
    public static $type_relation = array(
        '1'  => 'text',
        '10' => 'image',
        '20' => 'voice',
        '30' => 'video',
        '40' => 'news',
        '50' => 'news'
    );

    // 换取带参二维码的ticket
    public static $qrode_ticket_url = 'https://api.weixin.qq.com/cgi-bin/qrcode/create?access_token={ACCESS_TOKEN}';

    // 换取带参二维码
    public static $qrode_url        = 'https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket={TICKET}';
}